package hzst.android.form.info;

import hzst.android.Constants;

/**
 * 选择控件({@link #FMSelectView})绑定的数据
 * @author wt
 *
 */
public class SelectViewInfo extends EditViewInfo{
	private static final long serialVersionUID = 1L;
	
	private String selectSource;
	//为两位整数。第一位(0/1)用来判断是否多选；第二位(0/1/2)用来判断三种传值情况：名称、id、名称+id。
	private String selectType;
	private boolean isMultiple;
	private int passType;
	private String sourceUrl;//选择数据获取接口
	
	public static final String SOURCE_MEMBER = "member";
	public static final String SOURCE_SCIENTIFIC = "scientific";//课题

	public static final int PASS_TYPE_ALL = 0;
	public static final int PASS_TYPE_NAME = 1;
	public static final int PASS_TYPE_ID = 2;
	
	public String getSelectSource() {
		return selectSource;
	}

	public void setSelectSource(String selectSource) {
		this.selectSource = selectSource;
	}

	public String getSelectType() {
		return selectType;
	}

	public void setSelectType(String selectType) {
		this.selectType = selectType;
		isMultiple = Constants.TRUE.equals(selectType.substring(0, 1));
		passType = Integer.valueOf(selectType.substring(1));
	}

	public boolean isMultiple() {
		return isMultiple;
	}

	public int getPassType() {
		return passType;
	}

	public String getSourceUrl() {
		return sourceUrl;
	}

	public void setSourceUrl(String sourceUrl) {
		this.sourceUrl = sourceUrl;
	}
	
}
